<?php use_stylesheet('main.css') ?>
<span class="heading1">Matching Income</span>
<table id="data_list">
  <tbody>
    <tr>
      <th>S.No</th>
      <th>Date Of Income</th>
      <th>Investment Of Matching</th>
      <th>Matching Income</th>
    </tr>
    <?php
    $count = 0;
    $total = 0;
    foreach ($data as $item):
    $count++;
    $total += $item->getIncome();
    ?>
    <tr>
      <td><?php echo $count; ?></td>
      <td><?php echo $item->getCreatedAt($dateFormat); ?></td>
      <td><?php echo $currency; ?> <?php echo $item->getInvestment(); ?></td>
      <td><?php echo $currency; ?> <?php echo $item->getIncome(); ?></td>
    </tr>
    <?php
    endforeach;?>
  </tbody>
  <thead>
    <tr>
      <th colspan="2">Total Matching Income:</th>
      <td colspan="2"><?php echo $currency; ?> <?php echo $total; ?></td>
    </tr>
  </thead>
  <?php if (!count($data)): ?>
  <tfoot>
    <tr>
      <td colspan="4">Oops! No Transactions Found</td>
    </tr>
  </tfoot>
  <?php endif;?>
</table>